package cn.zhxu.pack;

public class ColorStrExt {

    /**
     * 色彩变暗
     */
    public String darken(String self, float rate) {
        return ColorRGB.parse(self).toHSB().darken(rate).toString();
    }

    public String darken(String self, double rate) {
        return darken(self, (float) rate);
    }

    public String darken(String self, int rate) {
        return darken(self, (float) rate);
    }

    /**
     * 色彩变亮
     */
    public String lighten(String self, float rate) {
        return ColorRGB.parse(self).toHSB().lighten(rate).toString();
    }

    public String lighten(String self, double rate) {
        return lighten(self, (float) rate);
    }

    public String lighten(String self, int rate) {
        return lighten(self, (float) rate);
    }

    /**
     * 色相翻转
     */
    public String reverse(String self) {
        return ColorRGB.parse(self).toHSB().reverse().toString();
    }

    /**
     * 色相旋转
     */
    public String rotate(String self, float rh) {
        return ColorRGB.parse(self).toHSB().rotate(rh).toString();
    }

    public String rotate(String self, double rh) {
        return rotate(self, (float) rh);
    }

    public String rotate(String self, int rh) {
        return rotate(self, (float) rh);
    }

    /**
     * 饱和度衰减
     */
    public String weaken(String self, float rate) {
        return ColorRGB.parse(self).toHSB().weaken(rate).toString();
    }

    public String weaken(String self, double rate) {
        return weaken(self, (float) rate);
    }

    public String weaken(String self, int rate) {
        return weaken(self, (float) rate);
    }

    /**
     * 饱和度增强
     */
    public String strengthen(String self, float rate) {
        return ColorRGB.parse(self).toHSB().strengthen(rate).toString();
    }

    public String strengthen(String self, double rate) {
        return strengthen(self, (float) rate);
    }

    public String strengthen(String self, int rate) {
        return strengthen(self, (float) rate);
    }

}
